package br.com.raxataxi.modelo;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table (name="CHAT")
public class Chat {
	
	@Id
	@GeneratedValue (strategy=GenerationType.AUTO)
	@Column (name="IDCHAT")
	private long idChat;
	@Temporal (TemporalType.DATE)
	@Column (name="DATACHAT")
	private Date dataCaht;
	@Temporal (TemporalType.TIME)
	@Column (name="HORACHAT")
	private Date horaChat;
	
	//Relacionamentos
	@ManyToMany (cascade=CascadeType.ALL)
	private List<Usuario> chatUsuario;
	@OneToMany (cascade=CascadeType.ALL)
	private List<Mensagem> chatMensagem;

}
